﻿<!--#include file="const.inc"-->

<%

Set Rs = Server.CreateObject("Adodb.Recordset")

	dim rs,sql,i,name,act,page,fleg,sttid,qingt

    		act = Request.QueryString("act")
	        if act="" then act=1
    		Page = Request("page")      '当前页数
    		If Page = "" Then Page = 1
   		If Not IsNumeric(Page) Then Page = 1
    		Page = CLng(Page)
    		If Page < 1 Then Page = 1
		listid=Request.QueryString("listid")
		if not isnumeric(listid) then listid=0
		if listid="" then listid=0
		listid=clng(listid)
                sttid=1000+listid
	Set Rs = Server.CreateObject("Adodb.Recordset")
	Sql = "SELECT [name],[logo],[flag],[bbs]  FROM [qingtian_bbs] where [del]=0 and [view]=0 and [id]="&listid
	Rs.Open Sql,conn,1,1
	if not (rs.bof and rs.eof)  then
	Footmark=rs("name")&"帖子列表"
		name=qingtian.utf8(rs("name"))
		flag=qingtian.utf8(rs("flag"))
		logo=qingtian.utf8(rs("logo"))
		bbs=rs("bbs")
        else
        qingt=true
	end if
	Rs.close

select case v
case "0"
we0="<br/>"
hr="-------------<br/>"
%>
<card title="<%=name%>论坛"><p align="<%=qingtian.px%>">
<%
case "1"
hr=""
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
ziz="<div style=""background-color:#FF5226;color:#E1E100"">"
%>
<title><%=name%>论坛</title>
</head>
<body>
<%

End Select
if qingt=true then qingtian.err("该论坛版块不存在")

		if logo<>"" then
		%><%=we%><img src="<%=logo%>" alt='logo' noselect = "true"/><%=we0%><%
		end if
%>
<%=qingtian.qingsav(sttid)%>
   <%

		if sid="Null" then
		%><%=we%><%=zi%>欢迎你<%=zi0%><a href="/login.asp?sid=<%=sidd%>&amp;url=/bbs/board.asp?listid=<%=listid%>">注册/登陆</a><%=we0%><%
		else
		qingtian.info
		end if
	if bbs=true and qingtian.nbz=true then
		qingtian.err("出错啦!本版为版主论坛,请确认你有版主权限!")
	elseif qingtian.qx("nologin", listid)=true then
		qingtian.err("出错啦!你已被禁止登陆本论坛,有任何问题请联系管理员!")
	else
		%>
<%=dao%><a href="fatie.asp?listid=<%=listid%>&amp;sid=<%=sidd%>">发帖</a><a href="zuan.asp?listid=<%=listid%>&amp;sid=<%=sidd%>">专题</a><a href="newli.asp?act=4&amp;sid=<%=sidd%>">精帖</a><a href="banzhu.asp?listid=<%=listid%>&amp;sid=<%=sidd%>">版主</a><a href="search.asp?listid=<%=listid%>&amp;sid=<%=sidd%>">搜索</a><%=we0%>
<%=ziz%><%=name%>帖子列表<%=we0%>
<%=hr%>
<%		
		if act=1 then
		Sql = "select  a.id,a.nid,a.name,a.top,a.good,a.vip,a.zuan,a.lock,a.bottom,a.browse,a.reply,a.vote,a.upfile,b.name,b.vip from [qingtian_bbs_forum] a,[qingtian_user] b where a.nid=b.id and a.del=0 and (a.listid="&listid&" or a.member=true) order by a.top asc,a.bottom desc,a.reptime desc"
		elseif act=2 then
		Sql = "select  a.id,a.nid,a.name,a.top,a.good,a.vip,a.zuan,a.lock,a.bottom,a.browse,a.reply,a.vote,a.upfile,b.name,b.vip from [qingtian_bbs_forum] a,[qingtian_user] b where a.nid=b.id and a.del=0 and (a.listid="&listid&" or a.member=true) order by a.top asc,a.bottom desc,a.id desc"
 		else
		Sql = "select  a.id,a.nid,a.name,a.top,a.good,a.vip,a.zuan,a.lock,a.bottom,a.browse,a.reply,a.vote,a.upfile,b.name,b.vip from [qingtian_bbs_forum] a,[qingtian_user] b where a.nid=b.id and a.del=0 and (a.listid="&listid&" or a.member=true) order by a.top asc,a.bottom desc,a.browse desc"
		end if


		Rs.Open Sql,conn,1,1



		if not (rs.bof and rs.eof)  then
				Rs.PageSize = 15	'一页N条记录
				IF Not IsEmpty(Page) Then
					IF Not IsNumeric(Page) Then		'判断Page是否为数字
						Page=1
					Else
						Page=Cint(Page)		'转换成短整形Integer
					End IF
					IF Page > Rs.PageCount Then
						Rs.AbsolutePage = Rs.PageCount	'设置当前显示页等于最后一页
					ElseIF Page <= 0 Then
						Rs.AbsolutePage = 1		'设置当前页等于第一页
					Else
						Rs.AbsolutePage = Page	'如果大于零,显示当前页等于接收的页数
					End IF
				Else
					Rs.AbsolutePage = 1
				End IF
				Page = Rs.AbsolutePage


		For i=1 to  Rs.PageSize
		If Rs.Eof Then
			exit For
		End If
dat=i+(page-1)*Rs.PageSize
%>			
<%=we%><%
                If RS("top") = True Then
                    Response.Write (""&zi&"<b>[顶]</b>"&zi0&"")
                ELSE
                    Response.Write (""&dat&".")                    
                End If
                If RS("a.vip") = True Then
                    Response.Write (""&zi&"<b>[vip]</b>"&zi0&"")
                End If
                If RS("good") = True Then
                    Response.Write (""&zi&"<b>[精]</b>"&zi0&"")
                End If
                If RS("lock") = True Then
                    Response.Write (""&zi&"<b>[锁]</b>"&zi0&"")
                End If
                If RS("vote") <> "" Then
                    Response.Write (""&zi&"<b>[投]</b>"&zi0&"")
                End If
                If RS("bottom") = True Then
                    Response.Write (""&zi&"<b>[底]</b>"&zi0&"")
                End If
                If RS("zuan") = True Then
                    Response.Write (""&zi&"<b>[专]</b>"&zi0&"")
                End If
                If RS("upfile") = True Then
                    Response.Write (""&zi&"<b>[附]</b>"&zi0&"")
                End If

		%><a href="viewv.asp?id=<%=rs("id")%>&amp;pageid=<%=page%>&amp;listid=<%=listid%>&amp;sid=<%=sidd%>"><%=qingtian.ubb2(rs("a.name"))%></a><%=we0%><%=sou%>[<a href="/user/spacev.Asp?urls=/bbs/board.asp?listid=<%=listid%>&amp;nid=<%=rs("nid")%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("b.name"))%></a>/阅<%=zi%><%=rs("browse")%><%=zi0%>/回<a href="showboard.asp?infoid=<%=rs("id")%>&amp;pageid=<%=page%>&amp;listid=<%=listid%>&amp;sid=<%=sidd%>"><%=zi%><%=rs("reply")%></a><%=zi0%>]<%=we0%>
<%
		
	 	Rs.MoveNext
	  	Next
%>
<%=hr%>
<%
                if rs.PageCount>1 then
                    Response.Write dao
                end if
   		'分页

    		If Page < rs.PageCount Then
    		    Response.Write("<a href='board.asp?act="&act&"&amp;listid=" & listid & "&amp;page=" & Page + 1 & "&amp;sid="&sidd&"'>下页</a>")
    		End If
   		If Page > 1 Then
    		    Response.Write("<a href='board.asp?act="&act&"&amp;listid=" & listid & "&amp;page=" & Page - 1 & "&amp;sid="&sidd&"'>上页</a>")
    		End If
    		If Page < rs.PageCount Then
    		    Response.Write("<a href='board.asp?act="&act&"&amp;listid=" & listid & "&amp;page=" & rs.PageCount & "&amp;sid="&sidd&"'>末页</a>")
   		    Response.Write("("&Page&"/"&rs.PageCount&")"&we0&"")
                elseif rs.PageCount > 1 Then
    		    Response.Write("<a href='board.asp?act="&act&"&amp;listid=" & listid & "&amp;page=1&amp;sid="&sidd&"'>首页</a>")
   		    Response.Write("("&Page&"/"&rs.PageCount&")"&we0&"")
    		End If

            
    		Randomize()
    
    		If rs.PageCount > 2 Then
    		    Randomize()
                if v=0 then
     		    Response.Write("共"&rs.RecordCount&"条<input name='Page' format='*N' size='2' maxlength='5'/><anchor>GO&gt;&gt;<go href='board.asp?act="&act&"&amp;listid=" & listid & "&amp;sid="&sidd&"&amp;run="& Int((9999) * Rnd() + 1) &"' method='post'><postfield name=""Page"" value=""$(Page:n)"" /></go></anchor><br/>")
                else
     		    Response.Write("<form action=""board.asp?act="&act&"&amp;listid=" & listid & "&amp;sid="&sidd&"&amp;run="& Int((9999) * Rnd() + 1) &""" method=""post"">共"&rs.RecordCount&"条<input type=""text"" name=""Page"" value="""" format=""*N"" size=""2"" maxlength=""5""/><input type=""submit"" value=""GO&gt;&gt;"" /></form><br/>")
                end if
    		End If
		else
    		    %>
<%=we%>还没有发表过任何帖子！<%=we0%><%=hr%>
		<%
		end if
		Rs.close
	set rs=nothing
		End If
if act=1 then
		%><%=we%>排序&gt;推荐<%=zi%>.<%=zi0%><a href="board.asp?act=2&amp;listid=<%=listid%>&amp;sid=<%=sidd%>">最新</a><%=zi%>.<%=zi0%><a href="board.asp?act=3&amp;listid=<%=listid%>&amp;sid=<%=sidd%>">最热</a><%=we0%><%=hr%><%
		elseif act=2 then
		%><%=we%>排序&gt;<a href="board.asp?act=1&amp;listid=<%=listid%>&amp;sid=<%=sidd%>">推荐</a><%=zi%>.<%=zi0%>最新<%=zi%>.<%=zi0%><a href="board.asp?act=3&amp;listid=<%=listid%>&amp;sid=<%=sidd%>">最热</a><%=we0%><%=hr%><%
		else
		%><%=we%>排序&gt;<a href="board.asp?act=1&amp;listid=<%=listid%>&amp;sid=<%=sidd%>">推荐</a><%=zi%>.<%=zi0%><a href="board.asp?act=2&amp;listid=<%=listid%>&amp;sid=<%=sidd%>">最新</a><%=zi%>.<%=zi0%>最热<%=we0%><%=hr%><%
		end if
%>
<%=qingtian.qingsav("34")%>
<%
End Function
%>